package com.itheima.d1_char_stream;

import java.io.FileReader;
import java.io.Reader;

public class FileReaderTest1 {
    public static void main(String[] args) {
        try (
                Reader fr=new FileReader("C:\\Users\\dell\\IdeaProjects\\file-io-app\\io-app2\\src\\itheima01.txt");
                ){
                 /*int c;
                 while((c=fr.read())!=-1){
                     System.out.print((char) c);
                 }*/

                 char[] buffer=new char[3];
                 int len;
                 while((len= fr.read(buffer))!=-1){
                     System.out.print(new String(buffer, 0, len));
                 }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
